var vue = new Vue({
	el: "body",
	data: {
		phone: "",
		pwd1: "",
		pwd2: ""
	},
	methods: {
		reg: function() {
			var token=sessionStorage.getItem("token");
			var appid=sessionStorage.getItem("appid");
			var _phone=new RegExp(/^1[34578]\d{9}$/).test(this.phone);
			var _pwd1=(this.pwd1.length>=6);
			var _pwd=(this.pwd1==this.pwd2);
			if(_phone&&_pwd1&&_pwd){
				user_register(token, appid);
			}else{
				alert("帐号或密码格式错误！")
			}
			
		}
	}
});
//用户注册
function user_register(token, appid) {
	$.ajax({
		type: 'get',
		url: "http://v2.mashupcloud.cn/SQL/reg/",
		data: {
			appid: appid,
			token: token,
			name: 'reg',
			_v1: vue.phone,
			_v2: vue.pwd1
		},
		success: function(json) {
			console.log("json==" + json);
			sessionStorage.setItem("username",vue.phone);
			location.href="../load/load.html";
		},
		error: function(json) {
			console.log("err:" + json);
		}
	});
}